package school30.io;

/**
 * Abstract class for writing files
 * Note: you should close connection to save writed data.
 *
 * @author asamarin97
 */
public abstract class FileWriter {

    /**
     * Write bytes to file
     * Note: you should close connection to save writed data.
     * 
     * @param b - byte array
     * @return writing result (0 - OK, -1 - Unknown error)
     */
    public abstract int write(byte[] b);

    /**
     * Closes connection
     * Note: if connection is not closed, file could be not saved properly.
     */
    public abstract void close();
}
